CFL reachability problem using Kronecker product#10
Open
Mamontyonok wants to merge 3 commits intoSparseLinearAlgebra:stablefrom
Open
CFL reachability problem using Kronecker product#10Mamontyonok wants to merge 3 commits intoSparseLinearAlgebra:stablefrom
Mamontyonok wants to merge 3 commits intoSparseLinearAlgebra:stablefrom
Conversation
gsvgit
reviewed
Mar 10, 2026
Member
gsvgit
left a comment
There was a problem hiding this comment.
Add more explanatory comments. For example look at this request
| GrB_Index nvals_old = 0, nvals_new = 0; | ||
| GrB_Matrix_nvals(&nvals_old, A); | ||
| while (true) { | ||
| GrB_mxm(A, NULL, GrB_LOR, GrB_LOR_LAND_SEMIRING_BOOL, A, A, NULL); |
| char *msg | ||
| ) | ||
| { | ||
| GrB_Matrix M3 = NULL; |
| GrB_Index r_dim = rsm->state_count; | ||
| GrB_Index kronecker_dim = r_dim * g_dim; | ||
|
|
||
| for (int64_t nt = 0; nt < rsm->nonterminal_count; ++nt) { |
Member
There was a problem hiding this comment.
It is hard to realize this loop. We iterate through all non-terminals. Each non-terminal must has related box and this box must has at least one final state. So, it is unclear what exactly we do in this loop.
Member
There was a problem hiding this comment.
Am I right, that you just handle boxes where the same state is both final and start?
| GrB_Matrix_clear(M3); | ||
|
|
||
| for (int64_t t = 0; t < terms_count; ++t) { | ||
| GrB_kronecker(M3, NULL, GrB_LOR, GrB_LAND, |
| GrB_Matrix_extractTuples_BOOL(i, j, V, &m3_nvals, M3); | ||
|
|
||
| for (GrB_Index k = 0; k < m3_nvals; ++k) { | ||
| GrB_Index s = i[k] / g_dim; |
| GrB_Index x = i[k] % g_dim; | ||
| GrB_Index y = j[k] % g_dim; | ||
|
|
||
| for (GrB_Index nt = 0; nt < rsm->nonterminal_count; ++nt) { |
Member
There was a problem hiding this comment.
Can it be done using matrix operations like select or reduce?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basic version of the CFLR algorithm is based on the Kronecker product